package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.JtPaymentAccountMapper;
import com.ruoyi.business.domain.JtPaymentAccount;
import com.ruoyi.business.service.IJtPaymentAccountService;
import com.ruoyi.common.core.text.Convert;

/**
 * 支付账号Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2025-05-22
 */
@Service
public class JtPaymentAccountServiceImpl implements IJtPaymentAccountService 
{
    @Autowired
    private JtPaymentAccountMapper jtPaymentAccountMapper;

    /**
     * 查询支付账号
     * 
     * @param accountId 支付账号主键
     * @return 支付账号
     */
    @Override
    public JtPaymentAccount selectJtPaymentAccountByAccountId(Long accountId)
    {
        return jtPaymentAccountMapper.selectJtPaymentAccountByAccountId(accountId);
    }

    /**
     * 查询支付账号列表
     * 
     * @param jtPaymentAccount 支付账号
     * @return 支付账号
     */
    @Override
    public List<JtPaymentAccount> selectJtPaymentAccountList(JtPaymentAccount jtPaymentAccount)
    {
        return jtPaymentAccountMapper.selectJtPaymentAccountList(jtPaymentAccount);
    }

    /**
     * 新增支付账号
     * 
     * @param jtPaymentAccount 支付账号
     * @return 结果
     */
    @Override
    public int insertJtPaymentAccount(JtPaymentAccount jtPaymentAccount)
    {
        jtPaymentAccount.setCreateTime(DateUtils.getNowDate());
        return jtPaymentAccountMapper.insertJtPaymentAccount(jtPaymentAccount);
    }

    /**
     * 修改支付账号
     * 
     * @param jtPaymentAccount 支付账号
     * @return 结果
     */
    @Override
    public int updateJtPaymentAccount(JtPaymentAccount jtPaymentAccount)
    {
        jtPaymentAccount.setUpdateTime(DateUtils.getNowDate());
        return jtPaymentAccountMapper.updateJtPaymentAccount(jtPaymentAccount);
    }

    /**
     * 批量删除支付账号
     * 
     * @param accountIds 需要删除的支付账号主键
     * @return 结果
     */
    @Override
    public int deleteJtPaymentAccountByAccountIds(String accountIds)
    {
        return jtPaymentAccountMapper.deleteJtPaymentAccountByAccountIds(Convert.toStrArray(accountIds));
    }

    /**
     * 删除支付账号信息
     * 
     * @param accountId 支付账号主键
     * @return 结果
     */
    @Override
    public int deleteJtPaymentAccountByAccountId(Long accountId)
    {
        return jtPaymentAccountMapper.deleteJtPaymentAccountByAccountId(accountId);
    }
}
